package org.jivesoftware.openfire.plugin.servlet;

import org.jivesoftware.openfire.plugin.kafka.ChatLogsConsumer;

import javax.servlet.http.HttpServlet;
import java.util.Timer;
import java.util.TimerTask;

public class AutoStartServlet extends HttpServlet {

    @Override
    public void init() {
        execTimer();
    }

    public static void execTimer() {
        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                new ChatLogsConsumer().run();
            }
        }, 1000 * 10);
    }

}
